import 'package:flutter/material.dart';

class FloatingActionButtonDemo extends StatelessWidget {
  final Widget _floatingActionButton = FloatingActionButton(
    onPressed: () {},
    elevation: 0.0,
    child: Icon(Icons.add),
    backgroundColor: Colors.yellow,
    shape: BeveledRectangleBorder(
      borderRadius: BorderRadius.circular(16.0),
    ),
  );

  final Widget _floatingActionButtonExtend = FloatingActionButton.extended(
    onPressed: () {},
    icon: Icon(Icons.add),
    label: Text('Add'),
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('FloatingActionButtonDemo'),
        elevation: 0.0,
      ),
      floatingActionButton: _floatingActionButtonExtend,
      //悬浮按钮和底部的NavigationBar部分重合
      floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
      bottomNavigationBar: BottomAppBar(
        child: Container(
          height: 80.0,
        ),
        //在NavigationBar重合的位置有缺口
        shape: CircularNotchedRectangle(),
      ),
    );
  }
}